Skip to main content
Version: 1.3.0

Summarization API Documentation

Text Summarization Endpoint

  • Method: POST
  • Path: https://api.kadal.ai/summarization/api/v1/text
  • Summary: Summarizes input text with configurable style and format.

Description

This endpoint generates a concise summary of the provided text. The summary can be tailored by choosing the language style (Formal, Casual, Normal), the output format (Paragraph or Key Points), and the AI model (gpt-4o or gpt-4o-mini) to balance quality and performance.

Request

  • Content-Type: application/x-www-form-urlencoded

Payload

ParameterDescriptionData TypeAllowed ValuesRequired
source_textInput text to be summarizedStringYes
language_styleTone/style of the summaryStringFormal, Casual, NormalYes
summary_formatStructure of the summary outputStringParagraph, Key PointsYes
modelAI model used for summarizationStringgpt-4o, gpt-4o-miniYes

Response

{
"status_code": 200,
"message": "Success: Summarization generated successfully.",
"summary": "Summarized text here"
}

Usage

import requests

# Define the API endpoint and the payload
url = "https://api.kadal.ai/summarization/api/v1/text"
token = "your_token_here"

headers = {
"Authorization": f"Bearer {token}"
}

data = {
"source_text": "Your source text will be given as input.",
"language_style": "Formal",
"summary_format": "Paragraph",
"model": "gpt-4o-mini"
}

# Make the POST request
response = requests.post(url, headers=headers, data=data)

# Print the response
if response.status_code == 200:
print("Response Data:", response.json())
else:
print("Failed to call the API. Status Code:", response.status_code)
print("Response Text:", response.text)

File Summarization Endpoint

  • Method: POST
  • Path: https://api.kadal.ai/summarization/api/v1/file
  • Summary: Summarizes input file with configurable style and format.

Description

This endpoint generates a concise summary of the provided file. The summary can be tailored by choosing the language style (Formal, Casual, Normal), the output format (Paragraph or Key Points), and the AI model (gpt-4o or gpt-4o-mini) to balance quality and performance.

Request

  • Content-Type: multipart/form-data

Payload

ParameterDescriptionData TypeAllowed valuesRequired
fileFile to be summarizedTxt, PDF, or Docx (Max size: 20 MB)Yes
language_styleTone/style of the summaryStringFormal, Casual, NormalYes
summary_formatStructure of the summary outputStringParagraph, Key PointsYes
modelAI model used for summarizationStringgpt-4o, gpt-4o-miniYes

Response

{
"status_code": 200,
"message": "Success: Summarization generated successfully.",
"summary": "Summarized text here"
}

Usage

import requests

# Define the API endpoint and the payload
url = "https://api.kadal.ai/summarization/api/v1/file"
token = "your_token_here"

headers = {
"Authorization": f"Bearer {token}"
}

data = {
"language_style": "Formal",
"summary_format": "Key Points",
"model": "gpt-4o-mini"
}

# Make the POST request
response = requests.post(url, headers=headers, data=data, files={"file": open("your_file_path", "rb")})

# Print the response
if response.status_code == 200:
print("Response Data:", response.json())
else:
print("Failed to call the API. Status Code:", response.status_code)
print("Response Text:", response.text)